package cn.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 环境测试
 * 注:发布到tomcat的根路径为"/"
 * <p>
 * 因为@Controller返回的是jsp或者html页面,此处不再写视图,故使用@RestController代替
 * @RestController = @Controller + @ResponseBody
 */
@RestController
@RequestMapping("env")
public class EnvController {
    @GetMapping("test")
    public String testEnv() {
        return "env passed.";
    }
    /**
     * 访问 http://localhost:8080/env/test
     * 页面显示 "env passed."
     */
}
